#include <iostream>
using namespace std;

int main()
{
    //单精度 float
    //双精度 double
    //默认情况下，输出一个浮点数时，会显示小数点后六位

    float f1 = 3.14f;

    cout << "f1 = " << f1 << endl;

    double d1 = 3.14;

    cout << "d1 = " << d1 << endl;
    
    //统计float和double占用内存空间
    cout << "float占用内存空间:" << sizeof(float) << endl;
    cout << "double占用内存空间:" << sizeof(double) << endl;

     //科学计数法
    float f2 = 3e2; //3 * 10^2
    cout << "f2 = " << f2 << endl;

    float f3 = 3e-2; //3 * 10^-2
    cout << "f3 = " << f3 << endl;

    return 0;
}